#pragma once

#include <SDL_opengl.h>
#include "font.h"
#include <map>
#include <string>
#include "color.h"
#include "vector2d.h"

struct ResImage
{
	ResImage();
	int num;
	GLuint tex_id;
	Vector2df corner;
	Vector2df size;
};

struct ResFont
{
	FTFont* font;
	int num;
};

class SAPPHIRE_ENGINE EngineResManager
{
public:
	EngineResManager(){}
	~EngineResManager();

	GLuint AddImage(const std::string &filename, Vector2df &size, Vector2df &corner);
	GLuint AddImage(const std::string &filename, const std::string &name,Vector2df &size, Vector2df &corner);

	GLuint AddImage(const std::string &filename, const Color &col,Vector2df &size, Vector2df &corner);
	GLuint AddImage(const std::string &filename, const std::string &name, const Color &col,Vector2df &size, Vector2df &corner);



	GLuint ModImage(const std::string &filename, const Color &col);
	void DelImage(const std::string &name);

	FTFont* AddFont(const std::string &filename);
	FTFont* AddFont(const std::string &filename, const std::string &name);
	void DelFont(const std::string &name);


private:
	std::map<std::string,ResImage> _img;
	std::map<std::string,ResFont> _font;
};